Disable underallocation warnings in non-debug builds
authorMatthias Clasen <mclasen@redhat.com>
Tue, 30 Aug 2011 12:44:13 +0000 (08:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 30 Aug 2011 15:28:52 +0000 (11:28 -0400)
It doesn't look like we have much traction of actually fixing
these, and there is very real cost to not being able to distcheck.

gtk/gtkwidget.c

index 8f5d6ff263f9a131fe767782798b71ed818d5c92..b95ce9a2d8f4f0eaff0de98274021892ba56c493 100644 (file)
@@ -4819,14 +4819,19 @@ gtk_widget_size_allocate (GtkWidget     *widget,
       gtk_widget_get_preferred_width_for_height (widget, real_allocation.height, &min_width, &natural_width);
     }
 
-  if ((min_width > real_allocation.width || min_height > real_allocation.height) &&
-      !GTK_IS_SCROLLABLE (widget))
-    g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. "
-               "Allocation is %dx%d, but minimum required size is %dx%d.",
-               priv->parent ? G_OBJECT_TYPE_NAME (priv->parent) : "", priv->parent ? "'s child" : "toplevel",
-               G_OBJECT_TYPE_NAME (widget), widget,
-               real_allocation.width, real_allocation.height,
-               min_width, min_height);
+#ifdef G_ENABLE_DEBUG
+  if (gtk_get_debug_flags () & GTK_DEBUG_GEOMETRY)
+    {
+      if ((min_width > real_allocation.width || min_height > real_allocation.height) &&
+          !GTK_IS_SCROLLABLE (widget))
+        g_warning ("gtk_widget_size_allocate(): attempt to underallocate %s%s %s %p. "
+                   "Allocation is %dx%d, but minimum required size is %dx%d.",
+                   priv->parent ? G_OBJECT_TYPE_NAME (priv->parent) : "", priv->parent ? "'s child" : "toplevel",
+                   G_OBJECT_TYPE_NAME (widget), widget,
+                   real_allocation.width, real_allocation.height,
+                   min_width, min_height);
+    }
+#endif
   /* Now that we have the right natural height and width, go ahead and remove any margins from the
    * allocated sizes and possibly limit them to the natural sizes */
   GTK_WIDGET_GET_CLASS (widget)->adjust_size_allocation (widget,